﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Circle.Utility;
using Circle.Web.ViewModelsClient;
using System.Text;

namespace Circle.Web.Application.Extension
{
    public static class Extensions
    {
        public static MvcHtmlString WebSiteHomeActionLink(this HtmlHelper htmlHelper, string linkText)
        {
            return htmlHelper.ActionLink(linkText, WebCircleConfig.DefaultSetting.HomePageAction, WebCircleConfig.DefaultSetting.HomePageController);
        }

        public delegate string MvcCacheCallback(HttpContextBase context);

        public static object Substitute(this HtmlHelper html, MvcCacheCallback cb)
        {
            html.ViewContext.HttpContext.Response.WriteSubstitution(
                c => cb(html.ViewContext.HttpContext)
                );
            return null;
        }

       
    }
}